<?php
include 'database.php';

$query = "SELECT * FROM pizza_aanbieding";
			
$result = mysqli_query( $dbcon, $query) or die();

echo "Aanbiedingen <br/>";

while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)){
	

	$query2 = "select name from pizza where id = '".$row['pizza_id']."'";
	$result2 = mysqli_query($dbcon, $query2) or die();
	
	while ($row2 = mysqli_fetch_array($result2, MYSQLI_ASSOC)){

		echo $row2 ['name'];
		echo "</br>";
		
	}

}

?>